This invention relates to queries directed to relational databases using Structured Query Language (SQL), and more particularly to obtaining graphical representations (data plots) of the data retrieved in accordance with those queries.
Structured Query Language (SQL) is an industry standard for writing queries to retrieve data from relational databases. In a typical database system (often called a relational database management system or RDBMS), shown schematically in FIG. 1, database 1 is controlled by database software on a server device 2. A user enters a query, written in SQL, on an input device 3 connected to a client device 4; the transmitted query 5 causes a dataset 6 to be returned from the database. In general, execution of an SQL query by a database system returns a text based dataset. A typical query is shown in FIG. 2A, requesting a count of selected distinct part numbers. As shown in FIG. 2B, the result of the query is a list 21 of part numbers and the corresponding counts 22, presented in two columns as text data (usually in a standard ASCII format). Usually the user wishes to process the data further, for example by making input to a calculation or presenting the data in the form of a graph.
If a graphical presentation of the text data is desired, the user must then manipulate the text data and use plotting software or plot the data manually. In either case, the user must perform a number of additional steps to obtain the data as a graph instead of text; furthermore, these steps are not part of the query process. At present there is no interface defined in the SQL standard which allows a user to specify that the query results should be plotted in a graph instead of being returned as raw text data. In particular, there are no existing keywords or user-selectable response formatting syntax which would permit graphical display of the returned query results.
Several systems and techniques have been proposed for generating database queries so that the queries may be viewed in graphical form. For example, “User-Defined Visual Query Language” (Cruz, Proc. IEEE Symposium on Visual Languages, St. Louis, October 1994, p. 224) describes an object-oriented database query language in which objects are given graphical definitions, so that the structure of the query may be viewed as a picture on a screen, and a user can extract information about the data in a visual fashion. Accordingly, the query is presented in a visualized form. U.S. Pat. No. 6,578,028 (Egilsson et al.) describes a graphical SQL query generator by which a standard SQL query may be constructed using a graphical user interface (GUI). Several statistical methods are described for calculating dependency matrices among the data in the database; the dependency matrices are associated with a relation definition. A GUI may be used with the matrices to construct an SQL query.
In addition, systems have been developed wherein types and characteristics of data returned from a database are presented graphically. U.S. Pat. No. 6,014,661 (Ahlberg et al.) describes an automated method for analyzing data fields in a database, in which data is downloaded from a database and relationships within the data set are displayed graphically; a GUI is used for interactive exploration of the database. Although this system facilitates analysis of and browsing in the database, the returned result of a query is still formatted only as text data. U.S. Pat. No. 5,636,350 (Eick et al.) describes a system in which characteristics of a result of a query are displayed graphically, and symbols are displayed whose appearance varies according to the number of items of data satisfying the query (number of hits).
None of the above-noted references discusses a method for plotting the actual data returned by a database query (as opposed to characteristics of the data). Furthermore, these systems do not include a way to specify graph plotting as part of the SQL query. There remains a need for a method which allows a user to query a database and graphically view the results without any intermediate steps.